<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>登录|精卫大数据平台</title>
    <meta name="author" content="leojie(leojie1314@gmail.com)">

    <link rel="stylesheet" type="text/css" href="${config.staticWebSite}/css/login.css">
    <link rel="stylesheet" type="text/css" href="${config.staticWebSite}/css/animate.css">
    <link rel="stylesheet" type="text/css" href="${config.staticWebSite}/css/common.css">
    <link rel="stylesheet" type="text/css" href="${config.staticWebSite}/css/dataview.css">
    <link rel="stylesheet" type="text/css" href="${config.staticWebSite}/css/icon.css">
    <script src="${config.staticWebSite}/js/jquery.min.js" type="text/javascript"></script>
    <script src="${config.staticWebSite}/assets/layer/layer.min.js" type="text/javascript"></script>
    <script src="${config.staticWebSite}/assets/axios/axios.min.js" type="text/javascript"></script>
    <script src="${config.staticWebSite}/assets/vue/vue.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        let path = ""
        let staticPath = ""

        $(document).ready(function () {
            path = "${config.siteUrl}"
            staticPath = "${config.staticWebSite}"
        })

        /**
         *取消/关闭DIV
         */
        function closeDiv(item) {
            $('#popover-mask' + item).fadeOut(100);
            $('#popover' + item).slideUp(200);
        }

        /**
         * 展示Div
         */
        function showDiv(item) {
            $('#popover-mask' + item).fadeIn(100);
            $('#popover' + item).slideDown(200);
        }
    </script>
    <link rel='shortcut icon' href='${config.staticWebSite}/img/f1_logo_small.ico' type=‘image/x-ico’/>

</head>
<body style="background-color:#e5e5e5">
<div class="login-background-img">
    <img src="${config.staticWebSite}/img/login_bg.jpg" id="login-bgImg" style="left: 0px;">
</div>
<div class="login_header">
    <div class="main_content">
        <span class="logo"></span>
    </div>
</div>
<div class="login_content main_content" id="app">
    <span class="logo"></span>
    <div class="login_iframe">
        <div class="header">登录精卫大数据平台</div>
        <a class="dropdown" href="javascript:void(0);" style="display: none;">
            <span class="dropdown-input"></span>
            <span class="dropdown-icon"><i></i></span>
        </a>
        <form id="main">
            <table class="lui_login_form_table">
                <tbody>
                <tr>
                    <td colspan="2" class="lui_login_message_td">
                        <div class="lui_login_message_div">

                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="lui_login_input_title">用户名：</td>
                    <td class="lui_login_input_td">
                        <div class="lui_login_input_div">
                            <input class="lui_login_input_username" style="" type="text" name="username" id="username"
                                   autofocus="autofocus" v-model="loginForm.username"/>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="lui_login_input_title">密　码：</td>
                    <td class="lui_login_input_td">
                        <div class="lui_login_input_div">
                            <input class="lui_login_input_password" type="password" name="password" id="password"
                                   v-model="loginForm.password"/>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="lui_login_button_td" colspan="2">
                        <a href="javascript:void(0);" @click.prevent="login">
                            <div class="lui_login_button_div_l">
                                <div class="lui_login_button_div_r">
                                    <div class="lui_login_button_div_c">登录</div>
                                </div>
                            </div>
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
            <input type="button" style="border: 0px; width: 0px; height: 0px; background: none;" name="btn_submit"
                   onclick="void(0);">
        </form>
    </div>
</div>

<script type="text/javascript">
    showDiv('_login');
    const app = new Vue({
        el: "#app",
        data: {
            loginForm: {
                username: '',
                password: ''
            }
        },
        methods: {
            login() {
                const url = path + 'user/doLogin.do';
                axios(
                    {
                        url: url,
                        method: 'post',
                        data: this.loginForm
                    }
                ).then(function (res) {
                    const data = res.data;
                    if (data.success) {
                        window.location.href = path + 'index';
                    } else {
                        layer.msg(data.msg)
                    }
                });
            }
        }
    })
</script>
</body>
</html>
